<div id="block-center" style="position: relative;">
    <div class="header-brown">
        <div class="icon"></div>
        <div class="title"> YOUR CART</div>
        <div class="clr"></div>
    </div>
    <div class="block-content-1">
            <div id="cartDetail">

                <div class="cartDetail-header">
                    <div class="col-th" style="width: 30px;">ID</div>
                    <div class="col-th" style="width: 195px;">Book title</div>
                    <div class="col-th" style="width: 60px;">Quantity</div>
                    <div class="col-th" style="width: 60px;">Price</div>
                    <div class="col-th" style="width: 60px;">Selloff</div>
                    <div class="col-th" style="width: 70px;">Total</div>
                    <div class="clr"></div>
                </div>
                <?php
                    $cart = $this->cart;
                    if(count($this->Items) > 0){
                        $totalPrice = 0;
                        foreach ($this->Items as $key => $val) {
                            $id = $val['id'];
                            $name = $val['name'];
                            $price = $val['price'];
                            $selloff = $val['selloff'];
                            $quantity = $cart[$id];
                            $total = 0;
                            if($selloff <= 0){
                                $price = '<span class="price-1">$' . $price . '</span>';
                                $selloff = ' ';
                                $total = $quantity * $val['price'];
                                $totalPrice += $total;
                                $total = "$" . $total;
                            }else{
                                $price = '<span class="price-1" style="text-decoration: line-through;">$' . $price . '</span>';
                                $selloff = "$" . $val['selloff'];
                                $total = $quantity * $val['selloff'];
                                $totalPrice += $total;
                                $total = "$" . $total;
                            }
                            $filter = new Zend_Filter();
                            $multiFilter = $filter->addFilter(new Zend_Filter_StringToLower(), array('encoding'=>'UTF-8'))
                                                  ->addFilter(new Zend_Filter_StringTrim())
                                                  ->addFilter(new Zend_Filter_Alnum(true))
                                                  ->addFilter(new Zend_Filter_PregReplace(array('match'=>'#\s+#', 'replace'=>'-')))
                                                  ->addFilter(new Zend_Filter_Word_SeparatorToDash())
                                                  ->addFilter(new Zendvn_Filter_RemoveCircumflex());

                            $linkDetail = $this->baseUrl('/shopping/index/detail/cid/' . $val['cat_id'] 
                                                        .'/tcat/' . $filter->filter($val['category_name']) 
                                                        . '/id/'. $val['id'] .'/title/' . $filter->filter($val['name']));
                            $itemProduct = $quantity;
                            
                            $linkOrder = $this->baseUrl('/shopping/index/order');
                            $linkBack = $this->baseUrl('/shopping/index/index');
                ?>
                <div class="cartDetail-row">
                    <div class="col-row" style="width: 30px;"><?php echo $id;?></div>
                    <div class="col-row" style="width: 195px;  text-align: left;">
                        <a href="<?php echo $linkDetail;?>" class="itemLink" target="_blank"><?php echo $name;?></a></div>
                    <div class="col-row" style="width: 60px;">
                        <?php echo $itemProduct;?>
                    </div>
                    <div class="col-row" style="width: 60px;"><?php echo $price;?></div>
                    <div class="col-row" style="width: 60px;"><?php echo $selloff;?></div>
                    <div class="col-row" style="width: 70px;"><?php echo $total;?></div>
                    <div class="clr"></div>
                </div>
                <?php 
                        }
                    }
                ?>
            </div>
            <div class="cartDetail-total"> Tổng số tiền bạn phải trả là: <span>$<?php echo $totalPrice;?></span></div>
            <?php
                $full_name = $this->formText('full_name','',array('style'=>'width: 60%;'));
                $emai = $this->formText('email','',array('style'=>'width: 60%;'));
                $phone = $this->formText('phone','',array('style'=>'width: 60%;'));
                $address = $this->formTextarea('address','',array('rows'=>'4', 'style'=>'width: 100%;'));
                $shipping = $this->formTextarea('shipping','',array('rows'=>'4', 'style'=>'width: 100%;'));
                $comment = $this->formTextarea('comment','',array('rows'=>'4', 'style'=>'width: 100%;'));
            ?>
            <form name="your-cart" id="your-cart" action="" method="post">
                <div class="cartDetail-order">
                    Xin vui lòng nhập đầy đủ thông tin vào Form sau: <br><br>
                    <label>Full Name:</label>
                    <div><?php echo $full_name;?></div>
                    <label>Email:</label>
                    <div><?php echo $emai;?></div>
                    <label>Phone:</label>
                    <div><?php echo $phone;?></div>
                    <label>Address:</label>
                    <div><?php echo $address;?></div>
                    <label>Shipping:</label>
                    <div><?php echo $shipping;?></div>
                    <label>Comment:</label>
                    <div><?php echo $comment;?></div>
                    <br>
                    <input type="submit" name="update" id="update" value="Order" class="button">
                </div>
            </form>
    </div>
</div>